package com.liuzh.deviceinfo.base;

import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import c.f.a.a.a.a;
import c.h.a.m0.i;

public abstract class BaseActivity extends AppCompatActivity {
    public int p;

    public void onCreate(Bundle bundle) {
        i iVar = i.a;
        iVar = i.a;
        int x = x(i.c());
        this.p = x;
        setTheme(x);
        getWindow().setStatusBarColor(a.n(this, 2130968785));
        super.onCreate(bundle);
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() != 16908332) {
            return super.onOptionsItemSelected(menuItem);
        }
        onBackPressed();
        return true;
    }

    public void onResume() {
        super.onResume();
        int i = this.p;
        i iVar = i.a;
        iVar = i.a;
        if (i != x(i.c())) {
            recreate();
        }
    }

    public int x(boolean z) {
        boolean y = y();
        return z ? y ? 2131755018 : 2131755019 : y ? 2131755017 : 2131755021;
    }

    public boolean y() {
        return true;
    }

    public void z() {
        ActionBar t = t();
        if (t != null) {
            t.n(true);
        }
    }
}
